package org.example.spring.self.demo.tl.c02.applicationlistener;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * onApplicationEvent 观察者模式
 */
@Component
public class TestApplicationListener implements ApplicationListener<ApplicationEvent> {
	@Override
	public void onApplicationEvent(ApplicationEvent event) {
		System.out.println(Thread.currentThread().getName() + "testApplicationListener 接收到一个事件" + event);
	}
}
